DATE

Syntax: DATE     
    or: DATE (year,month,day,hour,minute,second)
                              (Minerva, NewDate)
    or: DATE (year,month,day,hour,minute [,second])
                                       (SMS v2.57+)
Location: QL ROM

The function DATE returns the current date and time as the number of seconds since midnight on 1st January 1961.

NOTE:
Due to the way in which the system clock is implemented on the QL (it is stored as a 32-bit unsigned number), this causes problems with dates after 3.14:07 on 19th January 2029 (this would result in a number of seconds which needs to be stored in all 32 bits). Although the SDATE and DATE$ functions treat the number correctly, on non-Minerva ROMs and machines without SMS the DATE function ignores the most significant bit, meaning that it returns the wrong value for dates later than this.  A version (NewDate toolkit) is available which overcomes this problem.

On Minerva ROMs and under SMS, DATE treats the figure as a 32-bit signed number, which, although this means that later dates show as negative figures, does allow the line PRINT DATE$(DATE) to work correctly for all dates between 0.0:00 on 1st Jan 1961 and 6.28:15 on 6th Feb 2097.

MINERVA AND SMS NOTE:
DATE can accept the same six parameters accepted by SDATE. This enables you (for instance) to find out the day on a given date without having to alter the QL clock:

PRINT DAY$(DATE(1968,6,25,1,1,0))

CROSS-REFERENCE: 
SDATE will alter the QL clock.
DAY$ returns the day on the given date, DATE$ will return the current date.
T_ON and T_START can be used for accurate stop-watches for timing programs.
